﻿@using KRM.Core
@using KRM.Core.Library
@model KRM.Core.tblTicket
<div class="row-fluid">
    <form style="display: none" method="POST" id="frUploadfile_@Model.TicketID" enctype="multipart/form-data">
        <input type="file" name="FileUpload" style="float: right" id="inputUploadfile_@Model.TicketID" onchange="$('#frUploadfile_@Model.TicketID').submit()"/>
    </form>
    <form style="margin:0" id="frViewTicket_@Model.TicketID">
        <div class="span4">
            <input type="hidden" id="action_@Model.TicketID" name ="actionId" value="1"/>
            <input type="hidden" name="ticketId" value="@Model.TicketID"/>
            @Html.Partial("Partial/_MessageResult")
            <div class="fieldset">
                <div class="row-fluid">
                    <div class="span3">Assign To</div>
                    <div class="span9">
                        @Html.DropDownList("AssignToUserId", null, new { @class = "input-block-level" })
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="span3">Completed</div>
                    <div class="span5">
                        <div id="datetimepicker2_@Model.TicketID" class="input-append">
                            <input data-format="MM/dd/yyyy" type="text" name="CompleteByDate" value="" required="required" style="width: 61%;" />
                            <span class="add-on">
                                <i data-date-icon="icon-calendar" class="icon-calendar"></i>
                            </span>
                        </div>
                    </div>
                    <div class="span4">
                        <select name="CompleteByHrs" style="width: 50px; float: left; margin-left: -5px">
                            <option value="00">00</option>
                            <option value="18">18</option>
                            <option value="17">17</option>
                            <option value="16">16</option>
                            <option value="15">15</option>
                            <option value="14">14</option>
                            <option value="13">13</option>
                            <option value="12">12</option>
                            <option value="11">11</option>
                            <option value="10">10</option>
                            <option value="09">9</option>
                            <option value="08">8</option>
                        </select>
                        <select name="CompleteByMins" style="width: 50px; float: left;">
                            <option value="00">00</option>
                            <option value="15">15</option>
                            <option value="30">30</option>
                            <option value="45">45</option>
                        </select>
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="span3">Ccs</div>
                    <div class="span9 EmailCcTags">
                        <input type="text" class="" name="EmailCc" id="EmailCc_0">
                    </div>
                </div>
                <div class="row-fluid" style="margin-top: 10px">
                    <div class="span3">Bccs</div>
                    <div class="span9 EmailCcTags">
                        <input type="text" class="" name="EmailBcc" id="EmailBcc_0">
                    </div>
                </div>
            </div>
            <div class="fieldset">
                <div class="row-fluid">
                    <div class="span3">Tag</div>
                    <div class="span9">
                        <div class="input-block-level" style="max-height: 100px; overflow: auto; margin-bottom: 10px; border: solid 1px rgb(204, 204, 204);">
                            @foreach (tblTicketAllTag item in ViewBag.ListTags)
                            {
                                <div class="" style="margin-left: 10px;">
                                    <label class="checkbox">
                                        <input type="checkbox" name="Tags" value="@item.TagID"/>
                                        @item.Tag
                                    </label>
                                </div>
                            }
                        </div>
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="span3">Description</div>
                    <div class="span9">
                        <textarea class="input-block-level" rows="5" name="Description">@Model.Description</textarea>
                    </div>
                </div>
            </div>
        </div>
        <div class="span8">
            <div class="row-fluid TicketCommentDetail" style="height: 500px; overflow: auto;">
                <div class="box">
                    <div class="box-title" style="padding: 0px 0 7px 10px;">
                        <h5>
                            <span class="label label-warning">New</span>
                            Add New Ticket
                        </h5>
                    </div>
                    <div class="box-content" style="padding: 20px 20px 0px 10px">
                        <div class="row-fluid">
                            <div class="span12">
                                <input name="isPublicReply" class="input-block-level" type="hidden" value="1" />
                                <div class="row-fluid">
                                    <div class="span2">Deparment</div>
                                    <div class="span5">
                                        @Html.DropDownList("DepartmentId", null, "---Please select---", new { @required = "required", @class = "input-block-level" })
                                    </div>
                                </div>
                                <div class="row-fluid">
                                    <div class="span2">Subject</div>
                                    <div class="span10">
                                        <input name="Subject" class="input-block-level" type="text" required="required" />
                                    </div>
                                </div>
                                <div class="row-fluid">
                                    <div class="span2">Send To</div>
                                    <div class="span10">
                                        <input name="emailTo" class="input-block-level" type="email" required="required" />
                                    </div>
                                </div>
                                <p>Comment</p>
                                <textarea class="input-block-level" rows="10" id="NewComment_@Model.TicketID" name="NewComment" required="required"></textarea>
                                <div class="span8">
                                    <ul id="LstAttachment_@Model.TicketID">
                                    </ul>
                                </div>
                                <a href="javascript:;" onclick="$('#UploadAttachment_@Model.TicketID').modal('show')" style="float: right">Add Attachments</a>
                                <div id="UploadAttachment_@Model.TicketID" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                                    <div class="modal-header">
                                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                        <h4>Upload file attachments</h4>
                                    </div>
                                    <div class="modal-body" style="min-height: 200px">
                                        <a href="javascript:;" id="mulitplefileuploader_@Model.TicketID" style="margin-right: 10px">Select files</a>
                                        <div id="status_@Model.TicketID"></div>
                                    </div>
                                    <div class="modal-footer">
                                        <button class="btn btn-primary w100" data-dismiss="modal" aria-hidden="true">Done</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row-fluid" style="float: right; padding-right: 20px;">
                <div style="float: right">
                    <button type="submit" class="btn btn-primary">Submit as New</button>
                    <button type="reset" class="btn btn-default" id="btnResetFormAddTicket">Clear</button>
                </div>
            </div>
        </div>
    </form>
</div>
